<template>
  <div class="div-app">

    <el-dialog

      title="点位详情"
      :visible="dialogVisible"
      width="700px"
      @close="ishowchange"
    >
      <el-table
        v-loading="loading"
        :data="tableData"
        style="width: 100%"
        empty-text="暂无数据"
      >
        <el-table-column
          type="index"
          label="序号"
          width="60"
        />
        <el-table-column
          prop="innerCode"
          label="机器编号"
          width="130"
        />
        <el-table-column
          prop="vmStatus"
          label="设备状态"
          width="180"
        />
        <el-table-column
          prop="createTime"
          label="最后一次供货时间"
        />
      </el-table>
    </el-dialog>
  </div>
</template>
<script>
import { vmlistApi } from '@/api'
import { number } from 'echarts'
export default {

  name: 'Point33',
  props: {
    dialogVisible: {
      type: Boolean,
      default: true
    },
    id: {
      type: [String, number],
      default: ''
    }
  },
  data() {
    return {
      loading: true,
      tableData: []
    }
  },
  computed: {

  },
  async created() {
    const aa = await vmlistApi(this.id)
    this.tableData = aa.data
    this.tableDataa()
    this.loading = false
  },
  methods: {
    tableDataa() {
      this.tableData.forEach(itme => {
        if (itme.vmStatus === 0) {
          itme.vmStatus = '未投放'
        } else if (itme.vmStatus === 1) {
          itme.vmStatus = '运营'
        } else if (itme.vmStatus === 3) {
          itme.vmStatus = '撤机'
        }
      })
      return this.vmStatus
    },
    ishowchange() {
      this.isshowaa()
    },
    async regionget() {
    },

    isshowaa() {
      this.$emit('update:dialogVisible', false)
    }
  },
  // 级联改变触发
  handleChange() {
  }
}
</script>
  <style scoped lang="scss">
  .point-app{
      width: 700px;
      height: 400px;
      border-radius: 20px;
      background-color: pink;
  }
  ::v-deep .el-dialog{
     border-radius: 20px;
     .el-dialog__body{
      width: 550px;
      margin: 0 auto;
     }
  }
  ::v-deep .el-cascader{
    width: 100%;
  }
  ::v-deep .el-select{
    width: 100%;
  }
  </style>

